% TEST_ID: LANG-EXPAND-0031
% CATEGORY: language/array-ops/ops
% 测试 \ 运算符

function test_ldivide
    A = [1, 2; 3, 4];
    B = [5, 6; 7, 8];
    C = A \ B;
    assert_isclose(C, [-3 -4; 4 5]);

    A = [1, 2; 3, 4];
    B = [5;  6];
    C = A \ B;
    assert_isclose(C, [-4; 4.5]);
end

function assert_isclose(x, y)
    assert(all(abs(x - y) < 1e-14))
end
